#pragma once

class COrbitElemTransform
{
protected:
	COrbitElemTransform(void);
	~COrbitElemTransform(void);

public:
	struct Elements
	{ 
		Elements() {memset(this, 0, sizeof(Elements));};
		double ANM; 
		double PRH;
		double ANOD;
		double INC;
		double EXC;
		double DMOT;
	};

	const static double dDegrInRad;
	const static double dEclEcvAngle;

	static void RadiansToDegrise( Elements &elem);
	static void DegriseToRadians( Elements &elem);

	static bool CoordToElem( double AMASS, double x[3], double v[3], Elements &elem, double EPS = dEclEcvAngle);
	static bool ElemToCoord( double AMASS, double JT0, double JT, const Elements & elem, double x[3], double v[3], double EPS = dEclEcvAngle);

	static double ADMOT(double A , double AMASS);
	static double DMOTA(double DMOT, double AMASS);
protected:
	static double REDUCE(double A);
	static double KEPLER(double EXC, double ANM, double PREC);
	static int QUADR1(double C, double S, double &U, double &UPR, double &R);
	static int ORBMAT(double PRH, double ANOD, double AINC, double EPS, double P[3], double Q[3], double R[3]);
};
